package com.job.glogon;

/**
 * @author angzhijin
 * @Description
 * @create 2022-09-14 7:37 PM
 */
import java.util.*;
public class Glodon0914 {

    public static void main(String[] args) {
        A(args);
    }

    public static void A(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        sc.nextLine();
        for (int i = 0; i < T; i++) {
            char[] line = sc.nextLine().toCharArray();
            Stack<Character> stack = new Stack<>();
            int count =0;
            int len = line.length;
            for (int j = 0; j < len; j++) {
                char cur = line[j];
                if(stack.isEmpty() || cur!=stack.peek())
                    stack.push(cur);
                else{
                    stack.pop();
                    count++;
                }
            }
            System.out.println((count%2==0)? "No":"Yes");
        }
    }


    public static void B(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int k = sc.nextInt();
        /**
         * dp[n][m][l]
         */

//        int min = Math.min(n,m);
//        int max = Math.max(n,m);
//        if(k==1){
//            System.out.println(0);
//            return;
//        }
//        int[] costs = new int[k+1];
//        for (int i = 2; i < k+1; i++) {
//            if(i%min==2){
//                costs[i] = costs[i-1]+min*min;
//            }else{
//                costs[i] = costs[i-1]+1;
//            }
//        }
//        System.out.println(costs[k]);

    }
}
